<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改用户</title>
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/commom.css">
    <style>
        .box-padding-15 {
            padding: 15px;
        }
    </style>
</head>
<body>
<div class="layui-box box-padding-15">
    <div class="box-padding-15">
    <span class="layui-breadcrumb">
        <a href="/" target="_top">首页</a>
        <a href="/account">用户管理</a>
        <a><cite>编辑</cite></a>
    </span>
    </div>

<div class="form-style">
    <form class="layui-form" action="/account/update" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名：</label>
            <div class="layui-input-block">
                <input type="text" name="userName" value="${user.userName}"  lay-verify="required|username" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                <input type="hidden" name ="uId" value="${user.uId}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">职位：</label>
            <div class="layui-input-block">
                <input type="text" name="nickName"  value="${user.nickName}"   lay-verify="required|username" placeholder="请输入用户昵称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓名：</label>
            <div class="layui-input-block">
                <input type="text" name="realName" value="${user.realName}"  lay-verify="required|username" placeholder="请输入用户真实姓名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">电话号码：</label>
            <div class="layui-input-block">
                <input type="text" name="mobile" value="${user.mobile}"   lay-verify="required|phone|number" placeholder="请输入电话号码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">工号：</label>
            <div class="layui-input-block">
                <input type="text" name="personId" value="${user.personId}"  lay-verify="required|username" placeholder="请输入工号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态：</label>
            <div class="layui-input-block">
                <input type="checkbox" lay-filter="checkbox" name="userState" <c:if test="${user.userState  eq 1}" >checked</c:if> value="1" title="解冻">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">用户描述：</label>
            <div class="layui-input-block">
                <textarea name="remark" placeholder="请输入内容" class="layui-textarea">${user.remark}</textarea>
            </div>
        </div>
        <div class="layui-form-item" id="deptDiv">
            <label class="layui-form-label">选择部门：</label>
            <div class="layui-input-block">
                <select name="deptId" id="dept"  lay-filter="dept" lay-verify="required">
                    <option value="-1">--请选择部门--</option>
                    <c:forEach items="${depts}" var="dept">
                        <option value="${dept.deptId}" <c:if test="${dept.deptId == user.deptId}">selected</c:if> >${dept.deptName}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="layui-form-item" id="roleDiv">
            <label class="layui-form-label">选择角色：</label>
            <div class="layui-input-block">
                <select name="roleId" id="type"  lay-filter="type" lay-verify="required">
                    <option value="-1">--请选择角色--</option>
                    <c:forEach items="${roles}" var="role">
                        <option value="${role.roleId}" <c:if test="${role.roleId ==user.roleId}">selected</c:if> >${role.roleName}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">添加人员：</label>
            <div class="layui-input-block">
                <input type="text" name="addUser" value="${user.addUser}" lay-verify="required|username" placeholder="请输入添加人员" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" >
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit lay-filter="formDemo">完成</button>
                <a href="/account"><button type="button" class="layui-btn layui-btn-primary">取消</button></a>
            </div>
        </div>
    </form>
</div>
</div>
<script src="/static/plugins/jquery.js"></script>
<script src="/static/plugins/layui/layui.js"></script>
<script>
    layui.use(['form','element'], function(){

    });
</script>
</body>
</html>
